App({
  onLaunch: function (ops) {
     var app = this;
	 app.plugin_name='{plugin_name}';
	app.live_appid='{live_appid}';
    // 设备信息
	wx.getSystemInfo({
		success: function(res) {
				app.screenWidth = res.windowWidth;
				app.screenHeight = res.windowHeight;
				app.pixelRatio = res.pixelRatio;
		}
	});
	//获取粉丝信息
	var fansinfo=wx.getStorageSync('fansinfo');
	if(fansinfo){
		app.fansinfo=JSON.parse(fansinfo);
	}
	//登陆
	app.after_login=[];
	//重置ssid次数
	app.upsession_num=0;
	//根据访问的页面初始化app.access的值
	app.access={};
	if(ops.path){
		var path=ops.path.slice(0,-6).split('/');
		app.access.plugin=path.shift();
		app.access.action=path.join('.');
		for(var k in ops.query){
			if(k=='op'){
				app.access.op=ops.query[k]?ops.query[k]:'';
				ops.query[k]=undefined;
				break;
			}
		}
		app.access.query=app.util.made_query(ops.query);
	}else{
		app.access.plugin=app.plugin_name?app.plugin_name:'core';
		app.access.action='index/';
	}
  },
  onShow: function () {
  },
  onHide: function () {
    
  },
  onError: function (msg) {
    console.log(msg)
  },
  onPageNotFound:function(path,query){
	  //访问的页面不存在时，从app.access中获取访问地址，将地址拼接成http地址并访问
	  if(path.slice(0,6)=='/pages'){
		  wx.navigateTo({'url':'/core/welcome/index'});
	  }else{
		  wx.navigateTo({'url':'/core/html/html'});
	  }
  },
  globalData: {
    userInfo: null
  },
  'util':require('/resource/js/util.js'),
  'setting':{setting},
});